<?php 
include("common/header.html");
include("/var/www/html/new/conf/yd.le.je");
$ydle=new yd_go_sql();
$ydle->connect(); 
include("../_made/le.cfg.php");
include("common/left.html");
include('common/blogModel.php');
$id=$_REQUEST['id'];
$b=new blogModel();
$lists=$b->blogInfo($id);
$fid= $lists[0]['fid'];
$lists2=$b->personInfo($fid);
$author=$lists2[0]['account'];
/*$_SESSION['author']=$author;
$_SESSION['account']=$lists2[0]['account'];*/
$_SESSION['pic']=$lists[0]['pic'];
//print_r($lists2);
//print_r($lists);
?>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript">
$(function(){
	$("#addphoto").on("click",function(){
		$("textarea").before('<span style="margin-left:10px;"></span><input type="file" name="photo[]"/><br>'); 
	})
})
</script>
<link rel="stylesheet" href="http://www.12301.cc/css/page.css" media="all">
<script type="text/javascript" charset="utf-8" src="http://yd.12301.cc/ue_126/ueditor_config_mini.js"></script>
<!-- 核心文件 -->
<script type="text/javascript" src="http://yd.12301.cc/ue_126/ueditor.all.min.js"></script>
<div class="r_content" id="bind_tao">
    <h3 class="mc_title">
        <span class="mctit_1"><span class="mctit_2">管理员游记编辑</span></span>
    </h3>
	<div class="qunaertong">
		<form action="alterBlog.php" method="post" name="form" enctype="multipart/form-data">
		<?foreach($lists as $list){?>
			<input name="id" type="hidden" value="<?=$id?>">
			<p>
				<b class="tit">游记名称:</b>
				<span class="con1"><input type="text" class="inpcon" value="<?=$list['topic']?>" id="ch_ops" name="topic"/></span>
				
			</p>
			<p>
				<b class="tit">游玩时间:</b>
				<span class="con1"><input type="text" class="inpcon" value="<?=$list['playtime']?>" id="ch_ops" name="playtime"/></span>
			</p>
			
			<p>
				<b class="tit">游玩作者:</b>
				<span class="con1"><input type="text" class="inpcon" value="<?=$author?>" id="ch_ops" name="author"/></span>
			</p>
			<p>
				<b class="tit">作者id</b>
				<span class="con1"><input type="text" class="inpcon" value="<?=$list['fid']?>" id="ch_ops" name="authorid"/></span>
			</p>
			<!-- <p>
				<b class="tit">添加图片:</b>
				<span class="con1">
					<?$pic=explode("|",$list['pic']);
						for($i=0;$i<count($pic);$i++){
					?>
					<span style="margin-left:10px;"></span>
					<img class="image" style="width:600px;height:300px;" type="photo" name="pic[]" src="<?=$pic[$i]?>"/><br/>
					<?}?>
				</span>
			</p> -->
			<p>
				<b class="tit">游记正文:</b>
				<span class="con1"><textarea id="detailInfo" name="text" data-required="2" title="请输入" ><?=$list['content']?></textarea></span>
			</p>
			<p>
			<?if(isset($_REQUEST['outbox'])){?>
				<input type="submit" class="ok" name="action" id="save" value="取消发布" />
				<input type="submit" class="ok" name="action" id="save" value="保存" />
				<input  type="submit" id="Submit" name="action" value="删除"/>
			<?}else{?>
				<input  type="submit" id="save" class="ok" name="action" value="保存"/>
				<input  type="submit" id="save" class="ok" name="action" value="发布"/>
				<input  type="submit" id="save" name="action" value="删除"/>
			</p>
			<?}?>
			<?}?>
		</form>
		<script type="text/javascript">	
			$(document).ready(function () {
				var ue = UE.getEditor('detailInfo');
				
				$("#save").click(function(){
					var txt_content = ue.getContent();	
					$("#detailInfo").val(txt_content);
					$("form").submit();
				});	
			});
	
		</script>
	</div> 
<!-- <div class="button">
pif(isset($_REQUEST['outbox'])){p
<input  type="submit" id="Submit" name="action" value="保存"/>
<input  type="submit" id="Submit" name="action" value="取消发布"/>
<input  type="submit" id="Submit" name="action" value="删除"/>
}else{p
<input  type="submit" id="Submit" name="action" value="保存"/>
<input  type="submit" id="Submit" name="action" value="发布"/>
<input  type="submit" id="Submit" name="action" value="删除"/>
}p
</div>
}p
</form>
</div> -->


</div>
<?include("common/footer.html")?>